<template>
	<div class="i-login">
		<div><input type="text" v-model="body.account" placeholder="账号" /></div>
		<div><input type="password" v-model="body.passwd" placeholder="密码" /></div>
		<button @click="submit">登录</button>
	</div>
</template>
<script>
export default {
	name: "ILogin",
	components: {},
	props: {
		name: String,
	},
	data() {
		return {
			body: {
				account: "",
				passwd: "",
			},
		};
	},
	computed: {},
	mounted() {},
	methods: {
		submit() {
			postApi("/api/agent/login", this.body).then((res) => {
				this.local.token = res.token;
				localStorage.setItem("token", res.token);
			});
		},
	},
};
</script>
<style>
.i-login > div {
	margin-bottom: 12px;
}
</style>
